/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import blockbuster.utils.texture.GifHandler;
/*     */ import blockbuster.utils.texture.GifTexture;
/*     */ import java.util.Deque;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.renderer.texture.ITickable;
/*     */ import net.minecraft.client.renderer.texture.TextureManager;
/*     */ import net.minecraft.client.resources.IResourceManager;
/*     */ import net.minecraft.client.resources.IResourceManagerReloadListener;
/*     */ import net.minecraft.client.resources.IResourcePack;
/*     */ import net.minecraft.client.resources.SimpleReloadableResourceManager;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ import net.minecraftforge.client.model.ModelLoaderRegistry;
/*     */ import net.minecraftforge.fml.relauncher.ReflectionHelper;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class mr
/*     */   implements IResourceManagerReloadListener
/*     */ {
/*     */   public mr() {
/*  36 */     IResourceManager iResourceManager = Minecraft.func_71410_x().func_110442_L();
/*  37 */     if (iResourceManager instanceof SimpleReloadableResourceManager) {
/*  38 */       ((SimpleReloadableResourceManager)iResourceManager).func_110542_a(this);
/*     */     }
/*     */   }
/*     */   
/*     */   public static void h() {
/*  43 */     new mr();
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public static void z() {
/*  49 */     ela.s.z();
/*  50 */     Map a = (Map)ReflectionHelper.getPrivateValue(ModelLoaderRegistry.class, null, new String[] { "cache" });
/*  51 */     Deque deque = (Deque)ReflectionHelper.getPrivateValue(ModelLoaderRegistry.class, null, new String[] { "loadingModels" });
/*  52 */     Set set = (Set)ReflectionHelper.getPrivateValue(ModelLoaderRegistry.class, null, new String[] { "textures" });
/*  53 */     Map map1 = (Map)ReflectionHelper.getPrivateValue(ModelLoaderRegistry.class, null, new String[] { "aliases" });
/*     */     
/*  55 */     a.entrySet().removeIf(a -> ((ResourceLocation)a.getKey()).func_110624_b().equals("dragoncore"));
/*  56 */     deque.removeIf(a -> a.func_110624_b().equals("dragoncore"));
/*  57 */     set.removeIf(a -> a.func_110624_b().equals("dragoncore"));
/*  58 */     map1.entrySet().removeIf(a -> ((ResourceLocation)a.getKey()).func_110624_b().equals("dragoncore"));
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v() {
/*  63 */     System.out.println("开始重载资源文件");
/*  64 */     vda.q = false;
/*     */     
/*  66 */     Map a = (Map)ReflectionHelper.getPrivateValue(TextureManager.class, Minecraft.func_71410_x().func_110434_K(), new String[] { "mapTextureObjects", "field_110585_a" });
/*     */     
/*  68 */     a.entrySet().removeIf(a -> {
/*     */           boolean bool = "dragoncore".equals(((ResourceLocation)a.getKey()).func_110624_b());
/*     */           if (bool && a.getValue() instanceof hw) {
/*     */             hw hw = (hw)a.getValue();
/*     */             hw.func_147631_c();
/*     */           } 
/*     */           if (bool && a.getValue() instanceof GifTexture) {
/*     */             GifHandler.removeGif((ResourceLocation)a.getKey());
/*     */             ((GifTexture)a.getValue()).func_147631_c();
/*     */           } 
/*     */           return bool;
/*     */         });
/*  80 */     List list = (List)ReflectionHelper.getPrivateValue(TextureManager.class, Minecraft.func_71410_x().func_110434_K(), new String[] { "listTickables", "field_110583_b" });
/*     */     
/*  82 */     list.removeIf(a -> a instanceof wp);
/*     */     
/*  84 */     fw.i.reload();
/*     */ 
/*     */     
/*  87 */     z();
/*  88 */     xea.m.v();
/*  89 */     hg.v();
/*  90 */     ela.m.clear();
/*  91 */     gp.q.clear();
/*  92 */     gp.g.clear();
/*  93 */     tr.z();
/*     */     
/*  95 */     qp.w.z();
/*  96 */     qp.q.z();
/*  97 */     qp.i.z();
/*  98 */     zf.w.v();
/*  99 */     ov.q.v();
/* 100 */     rx.g.clear();
/*     */     
/* 102 */     vda.q = true;
/*     */     
/* 104 */     oa.z();
/*     */     
/* 106 */     System.out.println("资源文件重载完成");
/*     */   }
/*     */ 
/*     */   
/*     */   public void func_110549_a(IResourceManager iResourceManager) {
/* 111 */     if (iResourceManager instanceof SimpleReloadableResourceManager) {
/*     */ 
/*     */       
/* 114 */       ((SimpleReloadableResourceManager)iResourceManager).func_110545_a((IResourcePack)new rx());
/* 115 */       ((SimpleReloadableResourceManager)iResourceManager).func_110545_a((IResourcePack)new fw());
/* 116 */       ((SimpleReloadableResourceManager)iResourceManager).func_110545_a((IResourcePack)lv.q);
/*     */       
/* 118 */       if (vda.q) {
/* 119 */         vda.q = false;
/* 120 */         z();
/* 121 */         vda.q = true;
/*     */       } 
/*     */     } 
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\mr.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */